import React, { Component } from 'react';
import { HashRouter } from "react-router-dom";

import Admin from './Pages/Admin'
import Login from './Pages/Login';
import TeacherList from './Pages/Teacher/List';
import TeacherCourses from './Pages/Teacher/Courses';
import RouteWithSubRoutes from './utils/RouteWithSubRoutes';
import './App.css';


class App extends Component {

  state = {
    collapsed: false,
  };

  render() {

    let admin_routes = [
      {
        path: '/admin',
        component: Admin,
        routes: [
          {
            path: '/admin/teacher/index',
            component: TeacherList
          },
          {
            path: '/admin/teacher/course',
            component: TeacherCourses
          }
        ]
      },
      {
        path: '/login',
        component: Login
      }

    ];



    return (
      <HashRouter >
        <React.Fragment>
          {admin_routes.map((route, i) => <RouteWithSubRoutes key={i} {...route} />)}
        </React.Fragment>
      </HashRouter>
    );
  }
}

export default App;
